<?php


namespace app\models\order;


use think\Model;

class OrderDetailModel extends Model
{
    protected $name = 'order_detail';
    protected $autoWriteTimestamp = true;

    public function setGoodsBannerAttr($value)
    {
        if (!$value) {
            return $value;
        }
        return json_encode($value);
    }

    public function getGoodsBannerAttr($value)
    {
        if (!$value) {
            return $value;
        }
        return json_decode($value, true);
    }

    public function setGoodsDetailAttr($value)
    {
        if (!$value) {
            return $value;
        }
        return json_encode($value);
    }

    public function getGoodsDetailAttr($value)
    {
        if (!$value) {
            return $value;
        }
        return json_decode($value, true);
    }
}